package com.oneraku.service.controller;

import com.oneraku.service.domain.AddressInfo;
import com.oneraku.service.domain.WorkOrder;
import com.oneraku.service.domain.WorkOrderComment;
import com.oneraku.service.service.IAddressInfoService;
import com.oneraku.service.service.IWorkOrderCommentService;
import com.oneraku.service.service.IWorkOrderService;
import com.oneraku.service.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: hui.ren@huberbuy.com
 * @Date: 2020/2/26 11:25
 */
@RestController
@RequestMapping("/workOrder")
public class WorkOrderController {
    @Autowired
    private IWorkOrderService workOrderService;
    /**
     * 用户-工单列表
     * @param workOrder
     * @return
     */
    @PostMapping("/list")
    public R list(@RequestBody WorkOrder workOrder) {
        return workOrderService.listWorkOrder(workOrder);
    }
    /**
     * 用户-工单沟通记录
     * @param workOrderComment
     * @return
     */
    @PostMapping("/comments")
    public R comments(@RequestBody WorkOrderComment workOrderComment) {
        return workOrderService.comments(workOrderComment);
    }
    /**
     * 用户-提交工单
     * @param workOrder
     * @return
     */
    @PostMapping("/add")
    public R add(@RequestBody WorkOrder workOrder) {
        return workOrderService.addWorkOrder(workOrder);
    }
    /**
     * 用户-删除工单
     * @param workOrderComment
     * @return
     */
    @PostMapping("/del")
    public R del(@RequestBody WorkOrderComment workOrderComment) {
        return workOrderService.delWorkOrder(workOrderComment);
    }
    /**
     * 用户-增加工单的评论
     * @param workOrderComment
     * @return
     */
    @PostMapping("/addComments")
    public R addComments(@RequestBody WorkOrderComment workOrderComment) {
        return workOrderService.addComments(workOrderComment);
    }
}
